<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
	Edit <?php echo $name; ?>
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1>Edit <?php echo $name; ?></h1>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
		<fieldset>
			<legend>Edit <?php echo $name; ?></legend>
		<?php if (isset($errors)) 
				{
					foreach ($errors as $error)
					{
		?>
				<p class="msg error"><?php echo $error;?></p>
		<?php		}
				}
		?>
		<form method="post" action="<?php echo url('offer/update');?>">
		<input type="hidden" name="id" value="<?php echo isset($id) ? $id : ''; ?>" />
		
		<table class="nostyle">
			<tr>
				<td>Name:</td>
				<td><input type="text" class="input-text" name="name" value="<?php if (isset($name)) echo $name;?>"/></td>
			</tr>
			<tr>
				<td>Availability:</td>
				<td>
					<input type="radio" name="availability" value="0" <?php echo ('0' == $availability) ? 'checked="checked"' : ''; ?>/><label class="radio">Public</label>
					<input type="radio" name="availability" value="1" <?php echo ('1' == $availability) ? 'checked="checked"' : ''; ?>/><label class="radio">Private</label>
				</td>
			</tr>
			<tr>
				<td>IP Window:</td>
				<td><input type="text" class="input-text" name="ip_window" value="<?php if (isset($ip_window)) echo $ip_window;?>"/>days</td>
			</tr>
			<tr>
				<td>Cookie Window:</td>
				<td><input type="text" class="input-text" name="cookie_window" value="<?php if (isset($cookie_window)) echo $cookie_window;?>"/>days</td>
			</tr>
			<tr>
				<td colspan="2" class="t-right"><input type="submit" class="input-submit" value="Save"/></td>
			</tr>
		</table>
		</form>
	</fieldset>
</div>
<?php $this->_endblock(); ?>